import { Button, Col, Form, Row } from 'antd';
import MyCard from '../MyCard';
import styles from './index.less';
export default ({ onReset, form, onSubmit, configs = [] }) => {
  return (
    <MyCard>
      <Row gutter={[16, 16]}>
        <Col span={24}>
          <div className={styles.title}>筛选条件</div>
        </Col>
        <Col span={20}>
          <Form form={form} layout="inline" className={styles.formContainer}>
            {configs?.map?.((item) => (
              <Form.Item label={item.label} name={item.name} key={item.name}>
                {item.children}
              </Form.Item>
            ))}
          </Form>
        </Col>
        <Col span={4}>
          <div className={styles.rightOp}>
            <Button type="primary" onClick={onSubmit}>
              查询
            </Button>
            <Button onClick={onReset}>重置</Button>
          </div>
        </Col>
      </Row>
    </MyCard>
  );
};
